import 'package:flutter/material.dart';

class MyApp13 extends StatelessWidget {
  const MyApp13({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('ListView组件的使用'),
        backgroundColor: Colors.red,
        centerTitle: true,
      ),
      body: ListView(
        //横向滚动
        // scrollDirection: Axis.horizontal,
        //滚动禁用
        // physics: const NeverScrollableScrollPhysics(),
        children: [
          Container(
            height: 100,
            color: const Color.fromARGB(255, 149, 202, 222),
            child: const Text('我是容器1'),
          ),
          Container(
            height: 150,
            color: const Color.fromARGB(255, 192, 209, 247),
            child: const Text('我是容器2'),
          ),
          Container(
            height: 200,
            color: const Color.fromARGB(255, 199, 240, 176),
            child: const Text('我是容器3'),
          ),
          Container(
            height: 250,
            color: const Color.fromARGB(255, 244, 190, 226),
            child: const Text('我是容器4'),
          ),
          Container(
            height: 300,
            color: const Color.fromARGB(255, 191, 241, 194),
            child: const Text('我是容器5'),
          ),
          Container(
            height: 400,
            color: const Color.fromARGB(255, 251, 212, 188),
            child: const Text('我是容器6'),
          ),
        ],
      ),
    );
  }
}
